home *** CD-ROM | disk | FTP | other *** search
- /* Simcity city file structure -- Based on SIMFOR.TXT
- * Coded and uploaded by Ed Greenberg 76703,1070
- * Corrections welcome
- *
- * Note that the numbers that appear in the file are in high-low order,
- * backwards from the conventions of the iNTEL 80x86 family. They must be
- * reversed to be manipulated by C or assembler on the PC. Code to do this
- * is shown at the bottom of the file.
- *
- * Remember that this assumes that ints are 2 bytes and longs are 4. Unix
- * people will need to make adjustments. Since these are all even length
- * datatypes, no pragma pack's are needed.
- */
-
- struct _cityfile
- {
- char name[128];
- char ResHis[480];
- char ComHis[480];
- char IndHis[480];
- char CrimeHis[480];
- char PolluteHis[480];
- char CashFlowHis[480];
- struct _vars
- {
- unsigned int filler;
- unsigned int ExtMkt;
- unsigned int ResPop; /* doesn't make sense */
- unsigned int ComPop; /* doesn't make sense */
- unsigned int IndPop; /* doesn't make sense */
- unsigned int ResValve;
- unsigned int ComValve;
- unsigned int IndValve;
- unsigned long CityTime; /* divide by 48 and add 1900 */
- unsigned int CrimeRamp;
- unsigned int PolluteRamp;
- unsigned int LandValueAvg;
- unsigned int CrimeAvg;
- unsigned int PolluteAvg;
- unsigned int GameLevel;
- unsigned int CityClass;
- unsigned int CityScore;
- unsigned int filler1[32];
- unsigned long TotalFunds;
- unsigned int AutoBulldoze;
- unsigned int AutoBudget;
- unsigned int AutoGoto;
- unsigned int Sound;
- unsigned int TaxRate;
- unsigned int SimSpeed;
- unsigned long PoliceBud;
- unsigned long FireBud;
- unsigned long RoadBud;
- unsigned int filler2[56];
- } vars;
- unsigned int map[120][100]; /* 120 columns by 100 rows */
- } cityfile;
-
-
- /* code to reverse ints and longs
-
- THIS CODE IS COMMENTED OUT. CUT IT OUT AND PASTE IT INTO YOUR OWN PROGRAM
-
- int swapint(i)
- int i;
- {
- int t;
- t=i & 0xff;
- i >>= 8 ;
- i &= 0xff;
- i |= (t << 8);
- return i;
- }
-
- long swaplong(l)
- long l;
- {
- long t,ll;
- int i;
-
- t = 0L;
- ll = l;
- for(i=0;i<4;i++)
- {
- t<<=8;
- t |= (ll & 0xff);
- ll>>=8;
- }
-
- return t;
- }
-
-
- */
-